package com.example.tao_city.text1;


import android.os.Bundle;
import android.os.Handler;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.view.WindowManager;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.TextView;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by TAO_CITY on 2018/1/29.
 */

public class Fm1_tuikuangshengqing extends AppCompatActivity implements View.OnClickListener,Myadapter.Callbac {
    private ImageView back;
    private ListView listView;
    private List<Tuikuang_Item> list= new ArrayList();
    private Tuikuang_Item ti,ti2,ti1;
    private TextView hei;
    public static boolean run=false;
    private Handler ha=new Handler();
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.fm1_tuikuangshengqing);
        initview();
        setadapter();
    }

    private void initview() {
        back=findViewById(R.id.tuikuangshengqing_back);
        listView=findViewById(R.id.tuikuangshengqing_listview);
        hei=findViewById(R.id.tuikuangshengqing_hei);

        back.setOnClickListener(this);
    }
    private void setadapter(){
        ti=new Tuikuang_Item("62562256222355584",
                "2018-01-29  16:22:23","50元","申请退款","支付完成");
        list.add(ti);
        ti1=new Tuikuang_Item("62562256222355584",
                "2018-01-29  16:22:23","50元","申请退款","支付完成");
        list.add(ti1);
        ti2=new Tuikuang_Item("62562256222355584",
                "2018-01-29  16:22:23","50元","申请退款","支付完成");
        list.add(ti2);


        Myadapter md=new Myadapter(list,this,this);
        listView.setAdapter(md);

    }

    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case R.id.tuikuangshengqing_back:
                finish();
                break;
        }

    }

    @Override
    public void click(View v) {
        hei.setVisibility(View.VISIBLE);
        ha.postDelayed(ra,50);
    }
    Runnable ra=new Runnable() {
        @Override
        public void run() {
            if(run) {
                hei.setVisibility(View.INVISIBLE);
                run=false;
            }
            ha.postDelayed(ra,50);
        }
    };
}
